package ${package};

import org.jwebsocket.factory.JWebSocketFactory;
import java.util.Scanner;

public class App {

  private App() {
    throw new UnsupportedOperationException();
  }

  private static final char STOP_CHAR = 'x';

  public static void main(String[] args) {
    //todo set absolute path to jwebsocket.xml (file located in resources/xml directory)
    JWebSocketFactory.start("resources/xml/jwebsocket.xml");

    Scanner in = new Scanner(System.in);
    boolean continueWork = true;
    while (continueWork) {
      System.out.print("Press 'x' to close server ");
      String c = in.next();
      if (STOP_CHAR == c.charAt(0)) {
        continueWork = false;
      }
    }
    JWebSocketFactory.stop();
  }
}